xen: arm: do not BUG on guest paddrs which are very high
authorIan Campbell <ian.campbell@citrix.com>
Mon, 9 Dec 2013 11:09:10 +0000 (11:09 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 9 Dec 2013 15:25:50 +0000 (15:25 +0000)
commit9ed46ae6d29e5e87b45127d446e05db119c1b464
treec26846443d9a0416d82296e46edff3df25866fc8
parentcc0baa5cc313522282976cf291c809d644c0e644
xen: arm: do not BUG on guest paddrs which are very high

The BUG_ON in p2m_map_first was over aggressive since the paddr_t can have
come from the guest, via add_to_physmap. Instead return failure to the caller.

Also the check was simultaneously too lose. The valid offsets are
0..P2M_FIRST_ENTRIES-1 inclusive.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/p2m.c